import React from 'react'
import { SchemaForm, Item, Submit, Reset, FormItemGrid, Layout, SchemaType } from '@amazebird/antd-schema-form'

const schema: SchemaType = {
  field1: {
    label: '字段1',
    component: 'Input'
  },
  field2: {
    label: '字段2',
    component: 'Input'
  },
  field3: {
    label: '字段3',
    component: 'Input'
  },
  field4: {
    label: '字段4',
    component: 'Input'
  },
  field5: {
    label: '字段5',
    component: 'Input'
  },
  field6: {
    label: '字段6',
    component: 'Input'
  }
}

function Base() {
  return (
    <div style={{ width: 1000 }}>
      <SchemaForm schema={schema}>
        <FormItemGrid colCount={3} >
          <Item field="field1" />
          <Item field="field2" />
          <Item field="field3" />
          <Item field="field4" />
          <Item field="field5" />
          <Item field="field6" />
        </FormItemGrid>
        <Layout align="center">
          <Submit onFinish={(data) => { console.info(data) }} />
          <Reset />
        </Layout>
      </SchemaForm>
    </div>

  )
}

export default Base
